home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / rename.man < prev    next >
Encoding:
Text File  |  1989-01-31  |  5.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4. RENAME                C Library Procedures                 RENAME
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      rename - change the name of a file
  10.  
  11. SSYYNNOOPPSSIISS
  12.      rreennaammee((ffrroomm,, ttoo))
  13.      cchhaarr **ffrroomm,, **ttoo;;
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      _R_e_n_a_m_e causes the link named _f_r_o_m to be renamed as _t_o.  If
  17.      _t_o exists, then it is first removed.  Both _f_r_o_m and _t_o must
  18.      be of the same type (that is, both directories or both non-
  19.      directories), and must reside on the same file system.
  20.  
  21.      _R_e_n_a_m_e guarantees that an instance of _t_o will always exist,
  22.      even if the system should crash in the middle of the opera-
  23.      tion.
  24.  
  25.      If the final component of _f_r_o_m is a symbolic link, the sym-
  26.      bolic link is renamed, not the file or directory to which it
  27.      points.
  28.  
  29. CCAAVVEEAATT
  30.      The system can deadlock if a loop in the file system graph
  31.      is present.  This loop takes the form of an entry in direc-
  32.      tory "a", say "a/foo", being a hard link to directory "b",
  33.      and an entry in directory "b", say "b/bar", being a hard
  34.      link to directory "a".  When such a loop exists and two
  35.      separate processes attempt to perform "rename a/foo b/bar"
  36.      and "rename b/bar a/foo", respectively, the system may
  37.      deadlock attempting to lock both directories for modifica-
  38.      tion.  Hard links to directories should be replaced by sym-
  39.      bolic links by the system administrator.
  40.  
  41. RREETTUURRNN VVAALLUUEE
  42.      A 0 value is returned if the operation succeeds, otherwise
  43.      _r_e_n_a_m_e returns -1 and the global variable _e_r_r_n_o indicates
  44.      the reason for the failure.
  45.  
  46. EERRRROORRSS
  47.      _R_e_n_a_m_e will fail and neither of the argument files will be
  48.      affected if any of the following are true:
  49.  
  50.      [EINVAL]       Either pathname contains a character with the
  51.                     high-order bit set.
  52.  
  53.      [ENAMETOOLONG] A component of either pathname exceeded 255
  54.                     characters, or the entire length of either
  55.                     path name exceeded 1023 characters.
  56.  
  57.      [ENOENT]       A component of the _f_r_o_m path does not exist,
  58.                     or a path prefix of FIto _d_o_e_s _n_o_t _e_x_i_s_t.
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 22, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RENAME                C Library Procedures                 RENAME
  71.  
  72.  
  73.  
  74.      [_E_A_C_C_E_S]       A component of either path prefix denies
  75.                     search permission.
  76.  
  77.      [EACCES]       The requested link requires writing in a
  78.                     directory with a mode that denies write per-
  79.                     mission.
  80.  
  81.      [EPERM]        The directory containing _f_r_o_m is marked
  82.                     sticky, and neither the containing directory
  83.                     nor _f_r_o_m are owned by the effective user ID.
  84.  
  85.      [EPERM]        The _t_o file exists, the directory containing
  86.                     _t_o is marked sticky, and neither the contain-
  87.                     ing directory nor _t_o are owned by the effec-
  88.                     tive user ID.
  89.  
  90.      [ELOOP]        Too many symbolic links were encountered in
  91.                     translating either pathname.
  92.  
  93.      [ENOTDIR]      A component of either path prefix is not a
  94.                     directory.
  95.  
  96.      [ENOTDIR]      _F_r_o_m is a directory, but _t_o is not a direc-
  97.                     tory.
  98.  
  99.      [EISDIR]       _T_o is a directory, but _f_r_o_m is not a direc-
  100.                     tory.
  101.  
  102.      [EXDEV]        The link named by _t_o and the file named by
  103.                     _f_r_o_m are on different logical devices (file
  104.                     systems).  Note that this error code will not
  105.                     be returned if the implementation permits
  106.                     cross-device links.
  107.  
  108.      [ENOSPC]       The directory in which the entry for the new
  109.                     name is being placed cannot be extended
  110.                     because there is no space left on the file
  111.                     system containing the directory.
  112.  
  113.      [EDQUOT]       The directory in which the entry for the new
  114.                     name is being placed cannot be extended
  115.                     because the user's quota of disk blocks on
  116.                     the file system containing the directory has
  117.                     been exhausted.
  118.  
  119.      [EIO]          An I/O error occurred while making or updat-
  120.                     ing a directory entry.
  121.  
  122.      [EROFS]        The requested link requires writing in a
  123.                     directory on a read-only file system.
  124.  
  125.      [EFAULT]       _P_a_t_h points outside the process's allocated
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 22, 1986                          2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RENAME                C Library Procedures                 RENAME
  137.  
  138.  
  139.  
  140.                     address space.
  141.  
  142.      [EINVAL]       _F_r_o_m is a parent directory of _t_o, or an
  143.                     attempt is made to rename ``.'' or ``..''.
  144.  
  145.      [ENOTEMPTY]    _T_o is a directory and is not empty.
  146.  
  147. SSEEEE AALLSSOO
  148.      open(2)
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0               May 22, 1986                          3
  196.  
  197.  
  198.  
  199.